<form class="layui-form layui-form-pane" action="{:url('')}" id="editForm" method="post">

    <div class="layui-form-item">
        <label class="layui-form-label">名 称</label>
        <div class="layui-input-inline">
            <input type="text" class="layui-input field-areaname" name="areaname" lay-verify="required" autocomplete="off" placeholder="请输入名称">
        </div>
    </div>
    <div class="layui-form-item">
        <label class="layui-form-label">归 属</label>
        <div class="layui-input-inline">
            <select name="pid" class="field-pid" type="select">
                <option value="0">无</option>
                {$level_option}
            </select>
        </div>
    </div>
    <div class="layui-form-item">
        <label class="layui-form-label">分区栏目</label>
        <div class="layui-input-inline">
            <input type="radio" lay-filter="areatype" class="field-areatype" name="areatype" checked value="1" title="否">
            <input type="radio" lay-filter="areatype" class="field-areatype" name="areatype" value="2" title="是">
        </div>
        <div class="layui-form-mid layui-word-aux">仅有选中分区栏目才可以添加座位</div>
    </div>
    <div class="layui-form-item {eq name='data_info.areatype' value='1'}hidden{/eq}" id="tag">
        <label class="layui-form-label">标签</label>
        <div class="layui-input-inline">
            <input type="text" class="layui-input field-tag" name="tag" autocomplete="off" placeholder="请输入标签">
        </div>
        <div class="layui-form-mid layui-word-aux">如：历史、地理、经济</div>
    </div>
    <div class="layui-form-item">
        <div class="layui-input-block">
            <input type="hidden" class="field-id" name="id">
            <button type="submit" class="layui-btn layui-btn-normal" lay-submit lay-filter="formSubmit">提交</button>
            <a href="{:url('index')}" class="layui-btn layui-btn-primary ml10"><i class="aicon ai-fanhui"></i>返回</a>
        </div>
    </div>
</form>
{include file="admin@block/layui" /}
<script>
/* 修改模式下需要将数据放入此变量 */
var formData = {:json_encode($data_info)};

layui.use(['form', 'jquery'], function(){
    var $ = layui.jquery,form = layui.form;
    var form = layui.form;
    form.on('radio(areatype)', function(data){
        if (data.value == 1) {
            $('#tag').css('display','none');
        }else{
            $('#tag').css('display','block');
        }
    });
});

</script>
<style type="text/css">
    .hidden{display: none;}
</style>
<script src="__ADMIN_JS__/footer.js"></script>